package com.five.years.common.utils;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

public class PageUtil {

    public final static Integer pageSize = 10;

    public static <P, V> PageInfo<V> PageTrans(PageInfo<P> pageInfoPo) {
        Page<V> page = new Page<>(pageInfoPo.getPageNum(), pageInfoPo.getPageSize());
        page.setTotal(pageInfoPo.getTotal());
        PageInfo<V> vPageInfo = new PageInfo<>(page);
        vPageInfo.setEndRow(pageInfoPo.getEndRow());
        vPageInfo.setStartRow(pageInfoPo.getStartRow());
        vPageInfo.setSize(pageInfoPo.getSize());
        return vPageInfo;
    }
}
